package com.ruoyi.system.domain;

import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 代金券管理，记录代金券的基础信息、有效期、使用规则及兑换配置对象 voucher_management
 *
 * @author ruoyi
 * @date 2025-05-21
 */
public class VoucherManagement extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 自增主键ID，唯一标识每条代金券记录 */
    private Long id;

    /** 代金券名称（如“满100减20元券”“新用户专享券”） */
    @Excel(name = "代金券名称", readConverterExp = "如=“满100减20元券”“新用户专享券”")
    private String voucherName;

    /** 代金券编号（唯一标识，如VCH20230001） */
    @Excel(name = "代金券编号", readConverterExp = "唯=一标识，如VCH20230001")
    private String voucherCode;

    /** 代金券面值（单位：元，如20.00） */
    @Excel(name = "代金券面值", readConverterExp = "单=位：元，如20.00")
    private BigDecimal voucherValue;

    /** 有效期类型：无限期（unlimited）、按天数（by_days）、按固定日期（by_fixed_date） */
    @Excel(name = "有效期类型：无限期", readConverterExp = "u=nlimited")
    private String validityType;

    /** 按天数有效期（当validity_type为by_days时生效，单位：天） */
    @Excel(name = "按天数有效期", readConverterExp = "当=validity_type为by_days时生效，单位：天")
    private Integer validityDays;

    /** 固定有效期截止日期（当validity_type为by_fixed_date时生效） */
    @Excel(name = "固定有效期截止日期", readConverterExp = "当=validity_type为by_fixed_date时生效")
    private Date fixedExpiryDate;

    /** 状态：已启用（enabled）、已停用（disabled） */
    @Excel(name = "状态：已启用", readConverterExp = "e=nabled")
    private String status;

    /** 每次手动赠送限赠张数（0表示不限制，如每次最多赠送5张） */
    @Excel(name = "每次手动赠送限赠张数", readConverterExp = "0=表示不限制，如每次最多赠送5张")
    private Integer manualGiftLimitPerTime;

    /** 单次使用数量限制（JSON格式，示例：{"limit_type":"fixed","quantity":2}或{"limit_type":"unlimited"}） */
    @Excel(name = "单次使用数量限制", readConverterExp = "J=SON格式")
    private String usageLimitPerOrder;

    /** 积分兑换支持：不支持（unsupported）、支持（supported） */
    @Excel(name = "积分兑换支持：不支持", readConverterExp = "u=nsupported")
    private String pointsExchangeSupport;

    /** 使用规则（如满减条件、适用商品范围等，示例：“满100元可用，限指定商品使用”） */
    @Excel(name = "使用规则", readConverterExp = "如=满减条件、适用商品范围等，示例：“满100元可用，限指定商品使用”")
    private String usageRules;

    /** 可用时间（JSON格式，示例：{"all_days":true}或{"weekdays":["MON","TUE","WED","THU","FRI"]}或{"weekends":["SAT","SUN"]}） */
    @Excel(name = "可用时间", readConverterExp = "J=SON格式")
    private String applicableDays;

    /** 可用时间段（JSON格式，示例：[{"start_time":"09:00","end_time":"21:00"}]） */
    @Excel(name = "可用时间段", readConverterExp = "J=SON格式")
    private String applicableTimeRanges;

    /** 备注说明（如特殊使用规则、适用场景等） */
    @Excel(name = "备注说明", readConverterExp = "如=特殊使用规则、适用场景等")
    private String remarks;

    /** 手机号 */
    @Excel(name = "手机号")
    private String phone;

    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }

    public void setVoucherName(String voucherName)
    {
        this.voucherName = voucherName;
    }

    public String getVoucherName()
    {
        return voucherName;
    }

    public void setVoucherCode(String voucherCode)
    {
        this.voucherCode = voucherCode;
    }

    public String getVoucherCode()
    {
        return voucherCode;
    }

    public void setVoucherValue(BigDecimal voucherValue)
    {
        this.voucherValue = voucherValue;
    }

    public BigDecimal getVoucherValue()
    {
        return voucherValue;
    }

    public void setValidityType(String validityType)
    {
        this.validityType = validityType;
    }

    public String getValidityType()
    {
        return validityType;
    }

    public void setValidityDays(Integer validityDays)
    {
        this.validityDays = validityDays;
    }

    public Integer getValidityDays()
    {
        return validityDays;
    }

    public void setFixedExpiryDate(Date fixedExpiryDate)
    {
        this.fixedExpiryDate = fixedExpiryDate;
    }

    public Date getFixedExpiryDate()
    {
        return fixedExpiryDate;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public String getStatus()
    {
        return status;
    }

    public void setManualGiftLimitPerTime(Integer manualGiftLimitPerTime)
    {
        this.manualGiftLimitPerTime = manualGiftLimitPerTime;
    }

    public Integer getManualGiftLimitPerTime()
    {
        return manualGiftLimitPerTime;
    }

    public void setUsageLimitPerOrder(String usageLimitPerOrder)
    {
        this.usageLimitPerOrder = usageLimitPerOrder;
    }

    public String getUsageLimitPerOrder()
    {
        return usageLimitPerOrder;
    }

    public void setPointsExchangeSupport(String pointsExchangeSupport)
    {
        this.pointsExchangeSupport = pointsExchangeSupport;
    }

    public String getPointsExchangeSupport()
    {
        return pointsExchangeSupport;
    }

    public void setUsageRules(String usageRules)
    {
        this.usageRules = usageRules;
    }

    public String getUsageRules()
    {
        return usageRules;
    }

    public void setApplicableDays(String applicableDays)
    {
        this.applicableDays = applicableDays;
    }

    public String getApplicableDays()
    {
        return applicableDays;
    }

    public void setApplicableTimeRanges(String applicableTimeRanges)
    {
        this.applicableTimeRanges = applicableTimeRanges;
    }

    public String getApplicableTimeRanges()
    {
        return applicableTimeRanges;
    }

    public void setRemarks(String remarks)
    {
        this.remarks = remarks;
    }

    public String getRemarks()
    {
        return remarks;
    }

    public void setPhone(String phone)
    {
        this.phone = phone;
    }

    public String getPhone()
    {
        return phone;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("voucherName", getVoucherName())
                .append("voucherCode", getVoucherCode())
                .append("voucherValue", getVoucherValue())
                .append("validityType", getValidityType())
                .append("validityDays", getValidityDays())
                .append("fixedExpiryDate", getFixedExpiryDate())
                .append("status", getStatus())
                .append("manualGiftLimitPerTime", getManualGiftLimitPerTime())
                .append("usageLimitPerOrder", getUsageLimitPerOrder())
                .append("pointsExchangeSupport", getPointsExchangeSupport())
                .append("usageRules", getUsageRules())
                .append("applicableDays", getApplicableDays())
                .append("applicableTimeRanges", getApplicableTimeRanges())
                .append("remarks", getRemarks())
                .append("createTime", getCreateTime())
                .append("updateTime", getUpdateTime())
                .append("phone", getPhone())
                .toString();
    }
}
